<script>
if (window.testRunner) {
    testRunner.waitUntilDone();
    testRunner.dumpAsText();
}

addEventListener('change', function(e) {
    document.body.appendChild(document.getElementById('frame1'));
}, false);

var didStartTest = false;
function startTest() {
    if (didStartTest)
        return;
    didStartTest = true;
    var frameWindow = document.getElementById('frame1').contentWindow;
    frameWindow.innerInput.focus();
    outerInput.focus();
    document.execCommand('inserttext', false, 'abc');
    frameWindow.innerInput.focus();
    document.body.appendChild(document.createTextNode('PASS'));
    testRunner.notifyDone();
}
</script>
<div>
 <input value="foo" id="outerInput">
 <iframe onload="startTest()" id="frame1" height="100" width="540" srcdoc="&lt;input id='innerInput'>"></iframe>
</div>
